home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / extras / programm / gemfsc20 / gemfsc20.lzh / GNUGEM27 / VDIESC.C < prev    next >
C/C++ Source or Header  |  1993-03-24  |  4KB  |  231 lines

  1. /*        vdiesc.c
  2.  Copyright 1991 Jens Tingleff (uunet!titan.ee.ic.ac.uk!jensting)
  3.  
  4.  Dedicated to public domain
  5. */
  6.  
  7. #include <stddef.h>
  8.  
  9. #include "common.h"
  10.  
  11.  
  12.  
  13. #ifdef __DEF_ALL__
  14.  
  15. #define L_vq_chcel
  16. #define L_v_exit_c
  17. #define L_v_enter_
  18. #define L_v_curup
  19. #define L_v_curdow
  20. #define L_v_currig
  21. #define L_v_curlef
  22. #define L_v_curhom
  23. #define L_v_eeos
  24. #define L_v_eeol
  25. #define L_vs_curad
  26. #define L_v_curtex
  27. #define L_v_rvon
  28. #define L_v_rvoff
  29. #define L_vq_curad
  30.  
  31. #endif /* __DEF_ALL__ */
  32.  
  33.  
  34. #ifdef L_vq_chcel
  35.  
  36. /*        vq_chcells
  37.  * Inquire addressable aplha character cells.
  38.  * -1 for no cursor addressing (value for `*n_cols' ?)
  39.  */
  40. void vq_chcells(int handle, int *n_rows, int *n_cols)
  41. {
  42.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 1), handle);
  43.     *n_rows = _intout[0];
  44.     *n_cols = _intout[1];
  45. }
  46. #endif /* L_vq_chcel */
  47.  
  48.  
  49. #ifdef L_v_exit_c
  50.  
  51. /*        v_exit_cur
  52.  * Exit alpha mode.
  53.  */
  54. void v_exit_cur(int handle)
  55. {
  56.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 2), handle);
  57. }
  58. #endif /* L_v_exit_c */
  59.  
  60.  
  61. #ifdef L_v_enter_
  62.  
  63. /*        v_enter_cur
  64.  * Enter alpha mode
  65.  */
  66. void v_enter_cur(int handle)
  67. {
  68.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 3), handle);
  69. }
  70. #endif /* L_v_enter_ */
  71.  
  72.  
  73. #ifdef L_v_curup
  74.  
  75. /*        v_curup
  76.  * Alpha cursor up (do nothing if at top).
  77.  */
  78. void v_curup(int handle)
  79. {
  80.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 4), handle);
  81. }
  82. #endif /* L_v_curup */
  83.  
  84.  
  85. #ifdef L_v_curdow
  86.  
  87. /*        v_curdown
  88.  * Aplha cursor down (do nothing if at bottom).
  89.  */
  90. void v_curdown(int handle)
  91. {
  92.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 5), handle);
  93. }
  94. #endif /* L_v_curdow */
  95.  
  96. #ifdef L_v_currig
  97.  
  98. /*        v_curright
  99.  * Aplha cursor right (do nothing if at right edge).
  100.  */
  101. void v_curright(int handle)
  102. {
  103.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 6), handle);
  104. }
  105. #endif /* L_v_currig */
  106.  
  107. #ifdef L_v_curlef
  108.  
  109. /*        v_curleft
  110.  * Aplha cursor left (do nothing if at left edge).
  111.  */
  112. void v_curleft(int handle)
  113. {
  114.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 7), handle);
  115. }
  116. #endif /* L_v_curlef */
  117.  
  118. #ifdef L_v_curhom
  119.  
  120. /*        v_curhome
  121.  * Aplha cursor home.
  122.  */
  123. void v_curhome(int handle)
  124. {
  125.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 8), handle);
  126. }
  127. #endif /* L_v_curhom */
  128.  
  129.  
  130.  
  131. #ifdef L_v_eeos
  132.  
  133. /*        v_eeos
  134.  * Erase to end of screen.
  135.  */
  136. void v_eeos(int handle)
  137. {
  138.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 9), handle);
  139. }
  140. #endif /* L_v_eeos */
  141.  
  142.  
  143. #ifdef L_v_eeol
  144.  
  145. /*        v_eeol
  146.  * Erase to end of line.
  147.  */
  148. void v_eeol(int handle)
  149. {
  150.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 10), handle);
  151. }
  152. #endif /* L_v_eeol */
  153.  
  154.  
  155.  
  156. #ifdef L_vs_curad
  157.  
  158. /*        vs_curaddress
  159.  * Direct aplha cursor address.
  160.  */
  161. void vs_curaddress(int handle, int row, int col)
  162. {
  163.     _intin[0] = row;
  164.     _intin[1] = col;
  165.  
  166.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 11), handle);
  167. }
  168. #endif /* L_vs_curad */
  169.  
  170.  
  171. #ifdef L_v_curtex
  172.  
  173. /*        v_curtext
  174.  * Output cursor addressable text (string `s').
  175.  */
  176. void v_curtext(int handle, char *s)
  177. {
  178.     int i;
  179.  
  180.     if(*s == '\000')
  181.     {
  182.     return;
  183.     }
  184.  
  185.     for(i=0; s[i] != '\000'; i++)   /* Error checking ? we don't    */
  186.                     /* need no stinking error    */
  187.                     /* checking !            */
  188.     {
  189.     _intin[i] = s[i];
  190.     }
  191.  
  192.     __vdi__(VDI_CONTRL_ENCODE(5, 0, i, 12), handle);
  193. }
  194. #endif /* L_v_curtex */
  195.  
  196. #ifdef L_v_rvon
  197.  
  198. /*        v_rvon
  199.  * Reverse video on.
  200.  */
  201. void v_rvon(int handle)
  202. {
  203.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 13), handle);
  204. }
  205. #endif /* L_v_rvon */
  206.  
  207.  
  208. #ifdef L_v_rvoff
  209.  
  210. /*        v_rvoff
  211.  * Reverse video off
  212.  */
  213. void v_rvoff(int handle)
  214. {
  215.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 14), handle);
  216. }
  217. #endif /* L_v_rvoff */
  218.  
  219. #ifdef L_vq_curad
  220.  
  221. /*        vq_curaddress
  222.  * Inquire current cursor address.
  223.  */
  224. void vq_curaddress(int handle, int *cur_row, int *cur_col)
  225. {
  226.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 15), handle);
  227.     *cur_row = _intout[0];
  228.     *cur_col = _intout[1];
  229. }
  230. #endif /* L_vq_curad */
  231.